1. Field of the Invention
This invention relates to computer graphics displays and, more particularly, to methods and apparatus for rendering computer graphics displays tear free.
2. History of the Prior Art
The image presented on a computer output display is provided by continuously scanning information contained in a frame buffer to the output display. The frame buffer is a memory with sufficient storage space to contain information describing a single picture (or frame). The information stored in a frame buffer is scanned to the output display between sixty and seventy times each second in order to present the image. The image scanned to the output display is changed by changing the information stored in the frame buffer.
When a computer attempts to transfer information to a frame buffer during a period in which information is being transferred from the frame buffer to the output display, a tear in the output display may occur. This occurs because the information scanned to the output display as a single picture or frame in fact comes from two sequential frames. A portion of the image scanned to the display comes from what was intended to be one frame of the frame buffer while another portion of the display comes from what was intended to be a succeeding frame. This occurs because the data transfer to a frame buffer is not synchronized to the scan out of the frame buffer. Because of this, the raster beam may catch up with the transfer of information to the frame buffer from which the display is refreshed, or the transfer of information to the frame buffer may catch up with the raster beam so that the picture displayed in the window comes from two different frames of the frame buffer. Such an occurrence is called a "frame tear" and results in a flickering occurring on the output display. Although the flickering takes place over a very short period of time (a few frames), it is very disturbing to the viewer and unacceptable when producing an animated graphical output or a video display.
One way to cure image tearing is by double buffering the output to the display device. To accomplish this, two frame buffers are used. A first frame to be displayed is sent to the first frame buffer and stored. During this period in which the information is being placed in the first frame buffer, no information is scanned from that frame buffer to the output display; information is being scanned from a second frame buffer to the output display. Information may be scanned from the second frame buffer many times while the first frame buffer is being filled. Once the frame is completed within the first frame buffer and the frame in the second frame buffer has been completely scanned to the output display, the switch over occurs; the information in the first frame buffer is scanned to the output display. While information is being scanned to the output display from the first frame buffer, the succeeding frame is being placed in the second frame buffer. When the succeeding frame is completed in the second frame buffer and the frame in the first frame buffer has been completely scanned to the display, the frame in the second frame buffer is scanned to the output display while the first frame buffer is being filled with the next succeeding frame. The operation continues in this manner with changes being made only to one of the frame buffers while the information in the other frame buffer is being scanned to the output display.
Double buffering keeps information from being both written to and scanned from any single frame buffer during the same period of time. Consequently, no frame tearing occurs. However, double buffering doubles the size of the frame buffer memory required by a computer and substantially increases its cost. Generally, such arrangements are too costly for personal computers and are used only in high end work stations. Moreover, the arrangements necessary for providing windowing on an output display are quite complicated in a system using double buffering.
A method used to eliminate frame tearing using a single frame buffer utilizes an interrupt generated in response to the completion of the vertical scan of the output display to control the transfer of information to the frame buffer. For a short period following this interrupt signal the beam is moving from the end of the display back to the beginning, and no information is being scanned from the frame buffer to the display. During this interval, it impossible for a frame tear to occur; and information may safely be placed in the frame buffer. However, this vertical blanking time is insufficient if what is desired is to transfer information covering a large area of the output display. For example, the vertical blank interrupt signal may be used to transfer cursor information but generally will not work to transfer information for an area such as a window which may begin at any position and may include more information than might be transferred during the vertical blanking period.